package com.vhall.component.controller.account.facade;

import com.alibaba.fastjson.JSONObject;
import com.vhall.component.entity.account.vo.AccessListVO;
import com.vhall.component.entity.account.vo.AccessTokenVO;
import com.vhall.component.plugin.common.annotation.TokenAuth;
import com.vhall.component.plugin.common.annotation.VssTokenAuth;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * @author longzhen.gong
 * @date 2021/6/23 15:50
 */
@FeignClient(value = "UserFacade", path = "/v4/user")
public interface UserFacade {

    /**
     * 获取权限列表
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @VssTokenAuth
    @GetMapping(value = "/get-access-list")
    List<Integer> getAccessList(@Validated AccessListVO reqVO);


    /**
     * Console 获取token
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @TokenAuth
    @GetMapping(value = "/get-access-token")
    JSONObject getAccessToken(@Validated AccessTokenVO reqVO);

    /**
     * 获取vsstoken
     *
     * @return 返回值
     */
    @TokenAuth
    @GetMapping(value = "/get-vss-token")
    JSONObject getVssToken();

    /**
     * admin 获取paas Token
     *
     * @param reqVO
     * @return
     */
    @TokenAuth
    @GetMapping(value = "/admin/get-access-token")
    JSONObject paasAccess(@Validated AccessTokenVO reqVO);

}
